#include <stdio.h>

//计算y = 1!+2!+3!+...+n! n=30
long long func(int n)
{
    long long c;
    if (n == 1)
        c = 1;
    else
        c = n * func(n - 1);
    return c;
}
int main()
{
    int i;
    unsigned long long y = 0;
    for (i = 1; i <= 20; i++)
    {
        y = y + func(i);
        printf("%lld\n", func(i));
    }
    printf("the outcome = %lld", y);
    return 0;
}